/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.qinyeit.serviceapp.entity.enums.State;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * ClassName: ChangePrice <br/>
 * Function: 菜品变价单 <br/>
 * date: 2018-11-27 15:11:36 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="change_prices")
public class ChangePrice extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 菜谱id 
    @Column(name="menu_id")
	private Long menuId = null;

	// 菜品id 
    @Column(name="dishes_id")
	private Long dishesId = null;

	// 规格id 
    @Column(name="spec_id")
	private Long specId = null;

	// 标准价 
    @Column(name="old_price",scale=2)
	private Double oldPrice = null;

	// 变后标准价 
    @Column(name="price",scale=2)
	private Double price = null;

	// 会员价 
    @Column(name="old_vip_price",scale=2)
	private Double oldVipPrice = null;

	// 变后会员价 
    @Column(name="vip_price",scale=2)
	private Double vipPrice = null;

	// 变价原因 
    @Column(name="reason", length = 300)
	private String reason = null;

	// 生效时间
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="effective_time")
	private Date effectiveTime = null;

	// 状态 
    @Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private State state = State.NORMAL;

	// 操作人 
    @Column(name="operator_name", length = 300)
	private String operatorName = null;

	// 操作时间 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="operate_time")
	private Date operateTime = null;


	@Transient
	private String dishesName = "";

    @Tolerate
	public ChangePrice() {
		
	}
    @Tolerate
	public ChangePrice(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取菜谱id
	 */
	public Long getMenuId() {
		return this.menuId;
	}

    /**
     * 设置菜谱id
     */
	public ChangePrice setMenuId(Long menuId) {
		this.menuId = menuId;
		return this;
	}

	/**
	 * 获取菜品id
	 */
	public Long getDishesId() {
		return this.dishesId;
	}

    /**
     * 设置菜品id
     */
	public ChangePrice setDishesId(Long dishesId) {
		this.dishesId = dishesId;
		return this;
	}

	/**
	 * 获取规格id
	 */
	public Long getSpecId() {
		return this.specId;
	}

    /**
     * 设置规格id
     */
	public ChangePrice setSpecId(Long specId) {
		this.specId = specId;
		return this;
	}

	/**
	 * 获取标准价
	 */
	public Double getOldPrice() {
		return this.oldPrice;
	}

    /**
     * 设置标准价
     */
	public ChangePrice setOldPrice(Double oldPrice) {
		this.oldPrice = oldPrice;
		return this;
	}

	/**
	 * 获取变后标准价
	 */
	public Double getPrice() {
		return this.price;
	}

    /**
     * 设置变后标准价
     */
	public ChangePrice setPrice(Double price) {
		this.price = price;
		return this;
	}

	/**
	 * 获取会员价
	 */
	public Double getOldVipPrice() {
		return this.oldVipPrice;
	}

    /**
     * 设置会员价
     */
	public ChangePrice setOldVipPrice(Double oldVipPrice) {
		this.oldVipPrice = oldVipPrice;
		return this;
	}

	/**
	 * 获取变后会员价
	 */
	public Double getVipPrice() {
		return this.vipPrice;
	}

    /**
     * 设置变后会员价
     */
	public ChangePrice setVipPrice(Double vipPrice) {
		this.vipPrice = vipPrice;
		return this;
	}

	/**
	 * 获取变价原因
	 */
	public String getReason() {
		return this.reason;
	}

    /**
     * 设置变价原因
     */
	public ChangePrice setReason(String reason) {
		this.reason = reason;
		return this;
	}

	/**
	 * 获取生效时间
	 */
	public Date getEffectiveTime() {
		return this.effectiveTime;
	}

    /**
     * 设置生效时间
     */
	public ChangePrice setEffectiveTime(Date effectiveTime) {
		this.effectiveTime = effectiveTime;
		return this;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	/**
	 * 获取操作人
	 */
	public String getOperatorName() {
		return this.operatorName;
	}

    /**
     * 设置操作人
     */
	public ChangePrice setOperatorName(String operatorName) {
		this.operatorName = operatorName;
		return this;
	}

	/**
	 * 获取操作时间
	 */
	public Date getOperateTime() {
		return this.operateTime;
	}

    /**
     * 设置操作时间
     */
	public ChangePrice setOperateTime(Date operateTime) {
		this.operateTime = operateTime;
		return this;
	}

	public String getDishesName() {
		return dishesName;
	}

	public void setDishesName(String dishesName) {
		this.dishesName = dishesName;
	}

}
